//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.neurosky.thinkgear;

public class TGSamplingRateCalculator {
    private int a = 0;
    private int b = 0;
    private long c = System.currentTimeMillis();

    public TGSamplingRateCalculator() {
    }

    public int calcSamplingRate() {
        ++this.a;
        if(System.currentTimeMillis() - this.c < 2000L) {
            return 0;
        } else {
            this.b = (int)((long)this.a / ((System.currentTimeMillis() - this.c) / 1000L));
            if(this.b > 156 && this.b < 356) {
                this.b = 256;
            } else {
                if(this.b <= 412 || this.b >= 612) {
                    return 0;
                }

                this.b = 512;
            }

            return this.b;
        }
    }
}
